﻿using EMan.Common.DependencyInjection;

using TrueCode.DependencyManager;
using TrueCode.DependencyManager.BuildActions.BuildBit;
using TrueCode.DependencyManager.BuildActions.Injection;
using TrueCode.DependencyManager.BuildActions.Instantiating;
using TrueCode.DependencyManager.BuildActions.Lifetime;
using TrueCode.DependencyManager.Extensions;
using TrueCode.DependencyManager.Extensions.Action.Typed;
using TrueCode.DependencyManager.Services.Instantiating;
using TrueCode.DependencyManager.Services.Parameters;

namespace Test.Util.AutoMock
{
  public static class TestContainerFactory
  {
     public static Container CreateAutoMockContainer()
    {
      var mockContainer = new Container(typeof(IGetSessionalParameter), typeof( ISingleton), typeof (IInstantiate), typeof(ICreateMock));
      mockContainer
        .AddDefaultAction<ISingleton>(new BuildBit())
        .AddDefaultAction<IInstantiate>(new InstantiateByReflection())
        .AddDefaultAction<ICreateMock>(new CreateMockBuildAction())
        .AddDefaultService<IParameterProvider>(new AutoParameterProvider())
        .AddDefaultService<IConstructorProvider>(new MostParametersCountCtorProvider());
      return mockContainer;
    }
  }
}